<div
  ng-controller="WebsiteCtrl"
  ng-init="addAction()"
  class="sui-form form-horizontal"
>
  <form name="itemForm" novalidate>
    <ul class="sui-breadcrumb">
      <li>
        <a href="#/website/list">{{ "配置" | translate }}</a>
      </li>
      <li class="active">{{ "edit" | translate }}</li>
    </ul>

    <div class="control-group">
      <label class="control-label v-top"
        ><b style="color: #f00;">*</b>{{ "页面类型" | translate }}：</label
      >
      <div class="controls">
        <webiste-type ng-model="website.type" dft="1"></webiste-type>
      </div>
    </div>

    <web-site-tab ng-model="chosedType"></web-site-tab>
    <div ng-show="chosedType == 'slider'" class="sui-form form-horizontal">
      <div class="control-group">
        <div class="controls">
          <div
            ng-repeat="(msgkey, submsg) in website.data.homeSlider"
            style="border-bottom: gray 1px solid;margin-bottom: 20px;"
          >
            <div class="controls">
              <div>
                <img
                  ng-src="{{ submsg.img }}"
                  style="width:200px;height: 150px"
                />
                <attachment
                  owner-id="1"
                  owner-type="item"
                  dhf-ng-model="submsg.img"
                  xtype="url"
                  mult="false"
                  title="Upload"
                  use-type="png,jpeg,gif,jpg,JPG,PNG,JPEG,GIF"
                ></attachment>
                <button
                  type="button"
                  class="sui-btn btn-danger"
                  ng-click="website.data.homeSlider.splice($index,1)"
                >
                  {{ "delete" | translate }}
                </button>
              </div>
              <div>
                链接商品:
                <choice-item
                  item-check="itemdata(items,submsg)"
                  is-chose-item="1"
                  chosed-item="submsg.query.item_id"
                  skushow="1"
                ></choice-item>
                <div ng-if="submsg.query.item_id">
                  当前连接：{{ submsg.url }}?item_id={{ submsg.query.item_id }}
                </div>
              </div>
            </div>
          </div>
          <div>
            <a
              href="javascript:;"
              class="sui-btn btn-success btn-small"
              ng-click="addMsg(1);"
              style="margin-bottom: 10px;"
              >{{ "+新增" | translate }}</a
            >
          </div>
        </div>
      </div>
    </div>

    <div ng-show="chosedType == 'cattree'" class="sui-form form-horizontal">
      <div class="control-group">
        <div class="controls">
          <cat-tree
            ng-model="website.data.homeSliderCats"
            checkbox="1"
          ></cat-tree>
        </div>
      </div>
    </div>

    <div ng-show="chosedType == 'imagelinks'" class="sui-form form-horizontal">
      <div class="control-group">
        <div class="controls">
          <div
            ng-repeat="(msgkey, submsg) in website.data.homeLinks"
            style="border-bottom: gray 1px solid;margin-bottom: 20px;"
          >
            <div class="controls">
              <div>
                <img
                  ng-src="{{ submsg.img }}"
                  style="width:200px;height: 150px"
                />
                <attachment
                  owner-id="1"
                  owner-type="item"
                  dhf-ng-model="submsg.img"
                  xtype="url"
                  mult="false"
                  title="Upload"
                  use-type="png,jpeg,gif,jpg,JPG,PNG,JPEG,GIF"
                ></attachment>
                <button
                  type="button"
                  class="sui-btn btn-danger"
                  ng-click="website.data.homeLinks.splice($index,1)"
                >
                  {{ "delete" | translate }}
                </button>
              </div>
              <div>
                链接商品:
                <choice-item
                  item-check="itemdata(items,submsg)"
                  is-chose-item="1"
                  chosed-item="submsg.query.item_id"
                  skushow="1"
                ></choice-item>
                <div ng-if="submsg.query.item_id">
                  当前连接：{{ submsg.url }}?item_id={{ submsg.query.item_id }}
                </div>
              </div>
            </div>
          </div>
          <div>
            <a
              href="javascript:;"
              class="sui-btn btn-success btn-small"
              ng-click="addMsg(2);"
              style="margin-bottom: 10px;"
              >{{ "+新增" | translate }}</a
            >
          </div>
        </div>
      </div>
    </div>

    <div ng-show="chosedType == 'catlist'" class="sui-form form-horizontal">
      <div class="control-group">
        <div class="controls">
          <cat-tree ng-model="website.data.homeCats" checkbox="1"></cat-tree>
        </div>
      </div>
    </div>

    <div ng-show="chosedType == 'services'" class="sui-form form-horizontal">
      <div class="control-group">
        <div class="controls">
          <div
            ng-repeat="(msgkey, submsg) in website.data.homeSerivces"
            style="border-bottom: gray 1px solid;margin-bottom: 20px;"
          >
            <div class="controls">
              <div>
                <img
                  ng-src="{{ submsg.img }}"
                  style="width:200px;height: 150px"
                />
                <attachment
                  owner-id="1"
                  owner-type="item"
                  dhf-ng-model="submsg.img"
                  xtype="url"
                  mult="false"
                  title="Upload"
                  use-type="png,jpeg,gif,jpg,JPG,PNG,JPEG,GIF"
                ></attachment>
                <button
                  type="button"
                  class="sui-btn btn-danger"
                  ng-click="website.data.homeSerivces.splice($index,1)"
                >
                  {{ "delete" | translate }}
                </button>
              </div>
              <div>
                链接商品:
                <choice-item
                  item-check="itemdata(items,submsg)"
                  is-chose-item="1"
                  chosed-item="submsg.query.item_id"
                  skushow="1"
                ></choice-item>
                <div ng-if="submsg.query.item_id">
                  当前连接：{{ submsg.url }}?item_id={{ submsg.query.item_id }}
                </div>
              </div>
            </div>
          </div>
          <div>
            <a
              href="javascript:;"
              class="sui-btn btn-success btn-small"
              ng-click="addMsg(3);"
              style="margin-bottom: 10px;"
              >{{ "+新增" | translate }}</a
            >
          </div>
        </div>
      </div>
    </div>

    <div ng-show="chosedType == 'footer'" class="sui-form form-horizontal">
      <div class="control-group ">
        <label class="control-label ">底部logo图片：</label>
        <div class="controls ">
          <img
            ng-src="{{ website.data.footer.logourl }}"
            style="width:200px;height: 150px"
          />
          <br />
          <attachment
            owner-id="1"
            owner-type="item"
            dhf-ng-model="website.data.footer.logourl"
            xtype="url"
            mult="false"
            title="Upload"
            use-type="png,jpeg,gif,jpg,JPG,PNG,JPEG,GIF"
          ></attachment>
        </div>
      </div>

      <div class="control-group ">
        <label class="control-label ">公司名称：</label>
        <div class="controls ">
          <input type="text" ng-model="website.data.footer.comname" />
        </div>
      </div>

      <div class="control-group ">
        <label class="control-label ">ICP备案号：</label>
        <div class="controls ">
          <input type="text" ng-model="website.data.footer.icpcode" />
        </div>
      </div>

      <div class="control-group ">
        <label class="control-label ">公安备案号：</label>
        <div class="controls ">
          <input type="text" ng-model="website.data.footer.gacode" />
        </div>
      </div>

      <div class="control-group ">
          <label class="control-label ">其他图片：</label>
          <div class="controls ">
            <img
              ng-src="{{ website.data.footer.img1 }}"
              style="width:200px;height: 150px"
            />
            <br />
            <attachment
              owner-id="1"
              owner-type="item"
              dhf-ng-model="website.data.footer.img1"
              xtype="url"
              mult="false"
              title="Upload"
              use-type="png,jpeg,gif,jpg,JPG,PNG,JPEG,GIF"
            ></attachment>
          </div>

          <div class="controls ">
              <img
                ng-src="{{ website.data.footer.img2 }}"
                style="width:200px;height: 150px"
              />
              <br />
              <attachment
                owner-id="1"
                owner-type="item"
                dhf-ng-model="website.data.footer.img2"
                xtype="url"
                mult="false"
                title="Upload"
                use-type="png,jpeg,gif,jpg,JPG,PNG,JPEG,GIF"
              ></attachment>
            </div>

            <div class="controls ">
                <img
                  ng-src="{{ website.data.footer.img3 }}"
                  style="width:200px;height: 150px"
                />
                <br />
                <attachment
                  owner-id="1"
                  owner-type="item"
                  dhf-ng-model="website.data.footer.img3"
                  xtype="url"
                  mult="false"
                  title="Upload"
                  use-type="png,jpeg,gif,jpg,JPG,PNG,JPEG,GIF"
                ></attachment>
              </div>

              <div class="controls ">
                  <img
                    ng-src="{{ website.data.footer.img4 }}"
                    style="width:200px;height: 150px"
                  />
                  <br />
                  <attachment
                    owner-id="1"
                    owner-type="item"
                    dhf-ng-model="website.data.footer.img4"
                    xtype="url"
                    mult="false"
                    title="Upload"
                    use-type="png,jpeg,gif,jpg,JPG,PNG,JPEG,GIF"
                  ></attachment>
              </div>
              <div class="controls ">
                  <img
                    ng-src="{{ website.data.footer.img5 }}"
                    style="width:200px;height: 150px"
                  />
                  <br />
                  <attachment
                    owner-id="1"
                    owner-type="item"
                    dhf-ng-model="website.data.footer.img5"
                    xtype="url"
                    mult="false"
                    title="Upload"
                    use-type="png,jpeg,gif,jpg,JPG,PNG,JPEG,GIF"
                  ></attachment>
              </div>
      </div>
    </div>

    <div ng-show="chosedType == 'xmodal'" class="sui-form form-horizontal">
        <div class="control-group ">
          <label class="control-label ">提醒标题：</label>
          <div class="controls ">
            <input type="text" ng-model="website.data.xmodal.title" />
          </div>
        </div>
  
        <div class="control-group ">
          <label class="control-label ">提醒内容：</label>
          <div class="controls ">
            <textarea ng-model="website.data.xmodal.content" style="width: 600px;height: 400px;" ></textarea>
          </div>
        </div>
      </div>

    <div class="control-group ">
      <label class="control-label "></label>
      <div class="controls ">
        <button
          type="submit "
          id="submit "
          class="sui-btn btn-primary "
          ng-disabled="!itemForm.$valid "
          ng-click="websiteAdd($event) "
        >
          <span>{{ "save" | translate }}</span>
        </button>
      </div>
    </div>
  </form>
</div>
